<?
// -- webMS Modification --
  // Ensure a valid runtime environment or die
  if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

  // -- webMS Modification --
  // Check if osCommerce environment is already loaded
  if (defined( '_OSCOMMERCE_LOADED' )) {
    if (!DB_SHARED) {
      // Reconnect to osCommerce Database
      tep_db_connect() or die('Unable to connect to database server!');
    }
    // Load osCommerce Globals for Boxes
    global $category_links, $languages_id, $catID, $catID_array, $current_category_id;
    global $request_type, $lng, $cart, $currencies, $language, $navigation, $breadcrumb;
  } else {
    // Load osCommerce Environment for the First Time
    require('components/'.$option.'/includes/application_top.php');
  }
require(DIR_WS_LANGUAGES . $language . '/pricematch.php');
/*
  $Id: english.php,v 1.101 2002/11/11 13:30:16 project3000 Exp $
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2002 osCommerce
  Released under the GNU General Public License
  This cont. by Silus
*/
?>
<html><head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head><body>
<table width="100%" height="100%" bgcolor="#ffffff"><tr><td valign="top" align="center">
<div class="contentheading">
<?php
// Gets data from previous page pricematch.php
$this_Product = $_REQUEST['product'];
$this_Price = $_REQUEST['price'];
$this_c_price = $_REQUEST['c_price'];
$this_c_website = $_REQUEST['c_website'];
$this_Name = $_REQUEST['name'];
$this_email = $_REQUEST['email'];
$this_Code = $_REQUEST['code'];

// Constructs human readable pricematch string to be emailed
$this_Pricematch = PRICEMATCH_STRING1 . $this_Name . PRICEMATCH_STRING2 . $this_Product . " (" . $this_Code . "). " . PRICEMATCH_STRING3 . $this_Price . PRICEMATCH_STRING4 . $this_c_price . PRICEMATCH_STRING5 . $this_c_website . " .

" . PRICEMATCH_STRING6 . $this_email . PRICEMATCH_STRING7 . "
";

// Email details
$to = STORE_OWNER_EMAIL_ADDRESS;
$subject = PRICEMATCH_EMAIL_SUBJECT;
$body = $this_Pricematch;
$from = "From: " . $this_email;
if (mail($to, $subject, $body, $from)) {
  echo(PRICEMATCH_SUCCESS);
 } else {
  echo(PRICEMATCH_FAILURE);
 }
?>

<a href="javascript:window.close()"><?php echo PRICEMATCH_CLOSE_WINDOW; ?></a></div>
</td></tr></table>
</body></html>
